<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

  <!DOCTYPE html>  
  <html>  
  <head>  
      <title>Hello WebSocket</title>  
	  <script src="http://cdn.jsdelivr.net/sockjs/1/sockjs.min.js"></script>
	  <script src="http://cdn.bootcss.com/stomp.js/2.3.3/stomp.min.js"></script>
	  <script type="text/javascript" src="<%=basePath%>static/lib/jquery/1.9.1/jquery.min.js"></script> 
	  
      <script type="text/javascript">  
	      $(function(){  
	          var socket = new SockJS('/ComSystem/portfolio');  
	          var stompClient = Stomp.over(socket);  
	          stompClient.connect({}, function(frame) {//  
	              stompClient.subscribe("/topic/greeting", function(greeting){//注意这里的'/topic/hello'与上面Handler类updateAndSendMsg方法中的一样  
	                  console.log("msg :" + greeting)  
	              });  
	          });  
	      })  
      </script> 
  </head>  
  <body">  
  </body>  
  </html>  
